import { createStore } from 'redux';

const reducer = (state = {
  list: [1, 2, 3],
  a: 10
}, { type, payload }) => {
  switch (type) {
    case 'CHANGE_LIST':
      return { ...state, list: payload }
    case 'CHANGE_A':
      return Object.assign({}, state, { a: payload })
    default:
      return state
  }
}

const store = createStore(reducer)

export default store